import { Controller, Get, Req } from '@nestjs/common';
import { UserService } from '../services/user.service';
import { FastifyRequest } from 'fastify';

@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}

  @Get()
  async getUser(@Req() req: FastifyRequest) {
    return await this.userService.findOneFromView(req['userId']);
  }
}
